<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>

<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
	<meta charset="utf-8" />
	<title><?php echo ($webtitle); ?>－管理后台</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	   <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
 
	<!-- BEGIN GLOBAL MANDATORY STYLES -->          
	
	<link href="__ROOT__/Public/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="__ROOT__/Public/css/admin.css" rel="stylesheet" type="text/css"/>
	<link href="__ROOT__/Public/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<!-- END GLOBAL MANDATORY STYLES -->
	<!-- BEGIN THEME STYLES --> 
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="__ROOT__/Public/js/html5shiv.min.js"></script>
        <script src="__ROOT__/Public/js/respond.min.js"></script>
    <![endif]-->
	<!-- END THEME STYLES -->
		    <script src="__ROOT__/Public/js/jquery.js"></script>
    <script src="__ROOT__/Public/js/bootstrap.min.js"></script> 
	
 <script src="__ROOT__/Public/js/sco.ajax.js"></script> 
	  	<link href="__ROOT__/Public/css/print.css" rel="stylesheet" type="text/css"/>
		<script src="__ROOT__/Public/js/jquery-1.4.4.min.js" type="text/javascript"></script>	
		<script src="__ROOT__/Public/js/jquery.printPage.js" type="text/javascript"></script>
 
 <script type="text/javascript">  
  $(document).ready(function() {
    $(".btnrint").printPage();
  });
</script>

</head>
<!-- BEGIN BODY -->
<body>

<!-- BEGIN nav -->
	 <!-- BEGIN nav -->
<div role="navigation" class="navbar  navbar-default navbar-fixed-top">
        <div class=" container" >
        <div class="navbar-header">
          <button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a href="/" class="navbar-brand"><i class="fa fa-cloud"></i> WeiCake</a>
		  
        </div>

<p class="navbar-text" style="color:#FFF;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>


        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
		 
             <li class="nli"><a href="<?php echo U('Config/index/');?>" ><i class="fa fa-cog"></i> 基本设置</a></li>
            <li class="nli"><a href="<?php echo U('Foodcat/index/');?>"><i class="fa fa-th"></i> 商品</a></li>
			 <li class="nli"><a href="<?php echo U('Order/index/');?>"><i class="fa fa-shopping-cart"></i> 订单</a></li>
			 <li class="nli"><a href="<?php echo U('Credit/index/');?>"><i class="fa fa-leaf"></i> 积分</a></li>
			 
			 <li class="nli"><a href="<?php echo U('Member/index/');?>"><i class="fa fa-user"></i> 会员</a></li>
			<li class="nli"><a href="<?php echo U('Message/index/');?>"><i class="fa fa-rss-square"></i>留言</a></li>
			 
			<li class="nli"><a href="<?php echo U('Article/index/');?>"><i class="fa fa-user"></i> 文章</a></li>
			    <li class="nli"><a href="#"><i class="fa fa-comments"></i> 微信</a></li>
		
           
          </ul>
		  
		  <ul class="nav navbar-nav navbar-right">
		  
      <li><a href="<?php echo U('Config/unrunfile/');?>"> 清除缓存</a></li>
	     
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">更多 <b class="caret"></b></a>
        <ul class="dropdown-menu">
		   <li><a href="<?php echo U('Public/logout/');?>">退出</a></li>
          <li><a href="<?php echo U('Dbak/index/');?>">数据库备份</a></li>
     <li><a href="<?php echo U('Link/aindex/');?>">幻灯片</a></li>
      <li><a href="<?php echo U('Tag/index/');?>">标签管理</a></li>
	 <li><a href="<?php echo U('Link/index/');?>">友情链接</a></li>
	 
        </ul>
      </li>
    </ul>
		  
		  
		  
		  
		  
		  
		  
		  
        </div><!--/.nav-collapse -->
		
		
      </div>
    </div>
<!-- end nav -->

<!-- begin container -->
<!-- end nav -->

<!-- begin container -->

<div class=" container " style="margin-top:60px">

	

<div class="row">
     
	  
	  <div class="col-lg-12 col-md-12 col-xs-12" style="background-color: #FFF;">
	  
        <h3>订单管理</h3>
		<hr style="margin-top:0px;margin-bottom:0px;">
	
		  <p></P>
		 <div class="well"> 
		 <form class="form-inline">
  <div class="form-group">
    <label for="exampleInputName2">用户名：　</label>
    <input type="text" class="form-control" id="exampleInputName2" placeholder="登录用户名">
 　 </div>
  <div class="form-group">
    <label for="exampleInputEmail2">订单号：　</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="订单号">
 　 </div>
    <div class="form-group">
    <label for="exampleInputEmail2">手机号：　</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="手机号">
  　</div>
  <br><br>
    <div class="form-group">
    <label for="exampleInputEmail2">下单时间：</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="开始时间">
  
  　</div>
   <div class="form-group">
    <label for="exampleInputEmail2">至 　</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="结束时间">
  　
  </div>
  
    <div class="form-group">
    <label for="exampleInputEmail2">订单状态：</label>
     <select class="form-control">
  <option>已提交</option>
  <option>已确认</option>
  <option>配送中</option>
  <option>已完成</option>
  <option>已取消</option>
</select>
  </div>
  

  
  
  
  
  
  
   　　　　<button type="submit" class="btn btn-primary">搜索</button>
</form>
		 
		 </div>
         
           <div class="row"> 
     <div class="col-lg-10 col-md-10 col-xs-12" >
	<!--		 
	<form class="form-inline">
  <div class="form-group">
    <label for="exampleInputName2">订单号:</label>
    <input type="text" class="form-control" id="exampleInputName2" placeholder="Jane Doe">
  </div>
  <div class="form-group">
    <label for="exampleInputEmail2">用户名:</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com">
  </div>
    <div class="form-group">
    <label for="exampleInputEmail2">手机号:</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com">
  </div>
    <div class="form-group">
    <label for="exampleInputEmail2">用户名:</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com">
  </div>
<button type="submit" class="btn btn-default">Sign in</button>
  
  </form>


-->





			 
			 </div>
			 <div class="col-lg-4 col-md-4 col-xs-12" ><span class="help-block"></span> </div>
		  
		  </div><!-- end 添加 -->
		 
  <ul class="nav nav-tabs " >
		  <li class="active"><a href="<?php echo U('Order/index/');?>" ><b>全部订单</b></a></li>
             <li class=""><a href="<?php echo U('Order/index/');?>" ><b>最新提交</b></a></li>
             <li class=""><a href="<?php echo U('Order/index/');?>" ><b>已确认</b></a></li>
            <li class=""><a href="<?php echo U('Order/index/');?>" ><b>配送中</b></a></li>
             <li class=""><a href="<?php echo U('Order/index/');?>" ><b>已完成</b></a></li>
               
              
          </ul>

<br>

			  
			    <table class="table table-striped table-bordered table-hover">
									<thead>
										<thead>
          <tr>
            <th>订单号</th>
           
		   
		   <th>用户名/微信号</th>
		   <th>手机号</th>
            <th>下单时间</th>
            <th>订单金额</th>
			
			<th>结束时间</th>
			<th>支付方式</th>
			<th>订单状态</th>
			<th>操作</th>
          </tr>
        </thead>
									
									<tbody>
									<?php if(is_array($orderlist)): $i = 0; $__LIST__ = $orderlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
											<td><?php echo ($vo["oid"]); ?></td>
											
											
											
											<td><?php echo ($vo["uname"]); ?>/<?php if(empty($vo["gid"])): else: ?> <i class="fa fa-comments" style="color:green;"></i><?php endif; ?></td>
											<td><?php echo ($vo["tel"]); ?></td>
											<td><?php echo (date("Y-m-d H:i",$vo["order_ctime"])); ?></td>
											
											
											<td><?php echo ($vo["orderprice"]); ?></td>
											<td>
											<?php if(empty($vo["order_endtime"])): else: ?> <?php echo (date("Y-m-d H:i",$vo["order_endtime"])); endif; ?>

											</td>
											<td>
											
																					<?php switch($vo["paytype"]): case "1": ?>货到付款<?php break;?>
<?php case "2": ?>在线支付<?php break;?>

<?php default: endswitch;?>
											
											</td>
											<td><span style="color:#428BCA;font-size:10px;">
											<?php switch($vo["orderstatus"]): case "0": ?>订单提交<?php break;?>
<?php case "1": ?>已确认<?php break;?>
<?php case "2": ?>已确认<?php break;?>
<?php case "3": ?>送货中<?php break;?>
<?php case "4": ?>收货完成<?php break;?>
<?php case "5": ?>取消订单<?php break;?>
<?php case "6": ?>无效订单<?php break;?>
<?php default: ?>默认情况<?php endswitch;?>

</span>										
											</td>
											<td>
											
										<a class="btn btn-default btn-xs" href="<?php echo U('Order/detail/','id='.$vo['oid']);?>" data-toggle="modal" data-target="#myModal"> 查看</a>
																				<?php switch($vo["orderstatus"]): case "0": ?><a class="btn btn-primary btn-xs" href="<?php echo U('Order/orderone/','id='.$vo['oid']);?>" >确认</a> <a class="btn btn-default btn-xs" href="<?php echo U('Order/ordersix/','id='.$vo['oid']);?>" onClick="delq()">订单取消</a> <a class="btn btn-default btn-xs" href="<?php echo U('Order/delete/','id='.$vo['oid']);?>" onClick="delcfm()">删除</a><?php break;?>
<?php case "1": ?><a class="btn btn-primary btn-xs" href="<?php echo U('Order/ordertwo/','id='.$vo['oid']);?>" >出单</a> <a class="btn btn-default btn-xs btnrint" href="<?php echo U('Order/orderprint/','id='.$vo['oid']);?>" >打印</a> <a class="btn btn-default btn-xs" href="<?php echo U('Order/delete/','id='.$vo['oid']);?>" onClick="delcfm()">删除</a><?php break;?>
<?php case "2": ?><a class="btn btn-primary btn-xs" href="<?php echo U('Order/orderthree/','id='.$vo['oid']);?>" onClick="delcf()">送货</a> <a class="btn btn-default btn-xs btnrint" href="<?php echo U('Order/orderprint/','id='.$vo['oid']);?>" >打印</a> <a class="btn btn-default btn-xs" href="<?php echo U('Order/delete/','id='.$vo['oid']);?>" onClick="delcfm()">删除</a><?php break;?>
<?php case "3": ?><a class="btn btn-primary btn-xs" href="<?php echo U('Order/orderfour/','id='.$vo['oid']);?>" onClick="delc()">完成</a> <a class="btn btn-default btn-xs" href="<?php echo U('Order/delete/','id='.$vo['oid']);?>" onClick="delcfm()">删除</a><?php break;?>
<?php case "4": break;?>
<?php case "5": break;?>
<?php case "6": break;?>
<?php default: ?>默认情况<?php endswitch;?>
											
											
											</td>
											
										</tr><?php endforeach; endif; else: echo "" ;endif; ?>
									</tbody>
								</table>
			    
			  
			  
			  



			   <ul class="pagination">
							    <?php echo ($page); ?>
                                
                             </ul>

	 <p><span class="help-block">订单流程：订单提交－订单确认－订单配送－订单完成</span></P>


		   
		  
			  
			  
			  
			  </div><!-- tab1 -->
			  
	

			  
			  
			
             
	
     

	  
	  
	  
	
	 </div><!-- col end -->

</div><!-- end row -->


  


    
</div><!-- end container -->


    
         
	


	
<!-- /.modal -->



	<!-- Large modal-->


<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
     
    </div>
  </div>
</div>


	



	
	
	<script>
	
	function delcfm() {
if (!confirm("确认要删除操作？")) {
window.event.returnValue = false;
}
}
 
 function delcf() {
if (!confirm("确认订单需要配送？")) {
window.event.returnValue = false;
}
}
 function delc() {
if (!confirm("确认订单已完成？")) {
window.event.returnValue = false;
}
}
  function delq() {
if (!confirm("确认取消订单？")) {
window.event.returnValue = false;
}
}
</script>
	
	
	
	
	<!-- END FOOTER -->
	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->   

	
	
	
  


</body>
<!-- END BODY -->
</html>